package com.hackerrank.challenges.twoarrays;

import java.util.Arrays;
import java.util.Scanner;

public class Solution {
	/**
	 * @param args
	 */
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int T = in.nextInt();
		for(int t = 0; t < T; t++) {
			int N = in.nextInt(), K = in.nextInt(), A[] = new int[N], B[] = new int[N], i;
			for(i = 0; i < N; i++)
				A[i] = in.nextInt();
			for(i = 0; i < N; i++)
				B[i] = in.nextInt();
			Arrays.sort(A);
			Arrays.sort(B);
			for(i = 0; i < N; i++)
				if(A[i] + B[N - i - 1] < K)
					break;
			if(i == N)
				System.out.println("YES");
			else
				System.out.println("NO");
		}
	}
}
